﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;

namespace photoshop.ViewModels
{
    public class PrintBaseViewModel : INotifyPropertyChanged
    {
        public PrintBaseViewModel(BitmapSource photo, PrintTypeViewModel printtype, int quantity)
        {
            Photo = photo;
            PrintType = printtype;
            Quantity = quantity;
        }

        public PrintBaseViewModel(BitmapSource photo, string description, double cost)
        {
            Photo = photo;
            PrintType = new PrintTypeViewModel(description, cost);
            Quantity = 0;
        }

        private BitmapSource photo;
        public BitmapSource Photo
        {
            set { photo = value; OnPropertyChanged("Photo"); }
            get { return photo; }
        }

        private PrintTypeViewModel printType;
        public PrintTypeViewModel PrintType
        {
            set { printType = value; OnPropertyChanged("PrintType"); }
            get { return printType; }
        }

        private int quantity;
        public int Quantity
        {
            set { quantity = value; OnPropertyChanged("Quantity"); }
            get { return quantity; }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void OnPropertyChanged(String info)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(info));
        }

        public override string ToString()
        {
            return PrintType.ToString();
        }
    }
}
